package com.kaikeba.t31.ticket.service.impl;

import com.kaikeba.t31.core.service.impl.CrudServiceImpl;
import com.kaikeba.t31.ticket.dao.TrainNumberDao;
import com.kaikeba.t31.ticket.po.TrainNumber;
import com.kaikeba.t31.ticket.service.ITrainNumberService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TrainNumberServiceImpl extends CrudServiceImpl<TrainNumber> implements ITrainNumberService {
    @Resource
    private TrainNumberDao trainNumberDao;
    @Override
    public boolean saveOrUpdate(TrainNumber trainNumber) {
        System.out.println("saveOrUpdateTest");
        if(trainNumber.getId() == null){
            trainNumberDao.insert(trainNumber);
        } else {
            trainNumberDao.updateById(trainNumber);
        }
        return true;
    }
}
